home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / ctutor2 / define.c < prev    next >
Text File  |  1985-02-05  |  512b  |  17 lines

  1. #define START  0  /* Starting point of loop */
  2. #define ENDING 9  /* Ending point of loop */
  3. #define MAX(A,B)  ((A)>(B)?(A):(B))  /* Max macro definition */
  4. #define MIN(A,B)  ((A)>(B)?(B):(A))  /* Min macro definition */ 
  5.  
  6. main()
  7. {
  8. int index,mn,mx;
  9. int count = 5;
  10.  
  11.    for (index = START;index <= ENDING;index++) {
  12.       mx = MAX(index,count);
  13.       mn = MIN(index,count);
  14.       printf("Max is %d and min is %d\n",mx,mn);
  15.    }
  16. }
  17.